home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d4 / bronto.arc / BRONTO.BAS next >
BASIC Source File  |  1988-08-17  |  3KB  |  99 lines

  1. ' BRONTO is an EGA graphics program written for my 2 year old son James Nelson
  2. ' Start and Stop the brontosaurus with any key press.
  3. ' EGA board with 256K is required
  4. ' Program was written in Quickbasic;  Works only in 2.01 or higher
  5. ' Bronto.exe works without Quickbasic; Uses both screen pages with And/Or
  6. ' animation.  Send comments (no cash) to:
  7. '
  8. '                          Gordon Arbuthnot
  9. '                          8204 Bittern Lane
  10. '                          Indianapolis, IN 46256
  11. '                          Compuserve  [73125,1117]
  12. '                          GEnie G.Arbuthnot
  13.  
  14. ' put the title image in page 1; free up the data space used by the array
  15.  
  16. ' $DYNAMIC
  17. dim title%(23142)
  18. bload "title.bin",varptr(title%(0))
  19. screen 9,,1,0
  20. put (80,90),title%,pset
  21. screen ,,0,1    ' show the title in page 1; work in page 0
  22. erase title%    ' free up title array
  23.  
  24. 'get the images from disk and load into the arrays
  25.  
  26. dim image0%(1830)
  27. dim image0mask%(1830)
  28. dim image1%(1830)
  29. dim image1mask%(1830)
  30. dim background0%(1830)
  31. dim background1%(1830)
  32. dim rock%(181)
  33. dim rockmask%(181)
  34. dim dscene%(15000)
  35. bload "d11.bin",varptr(image0%(0))
  36. bload "d11m.bin",varptr(image0mask%(0))
  37. bload "d21.bin",varptr(image1%(0))
  38. bload "d21m.bin",varptr(image1mask%(0))
  39. bload "rock.bin",varptr(rock%(0))
  40. bload "rockm.bin",varptr(rockmask%(0))
  41.  
  42. 'set critical movement parameters
  43.  
  44. shift%=5
  45. xw%=134:yw%=49
  46.  
  47. 'put background into page 0
  48.  
  49. bload "dscene1.bin",varptr(dscene%(0))
  50. put (0,0),dscene%,pset
  51. bload "dscene2.bin",varptr(dscene%(0))
  52. put (0,91),dscene%,pset
  53. bload "dscene3.bin",varptr(dscene%(0))
  54. put (0,181),dscene%,pset
  55. bload "dscene4.bin",varptr(dscene%(0))
  56. put (0,271),dscene%,pset
  57. get (500,130)-(500+xw%,130+yw%),background0%
  58. get (500-shift%,130)-(500-shift%+xw%,130+yw%),background1%
  59. put (500,130),image0mask%,and
  60. put (500,130),image0%,or
  61. put (275,172),rockmask%,and
  62. put (275,172),rock%,or
  63.  
  64. screen ,,1,0     ' show loaded scene; work in page 1
  65. pcopy 0,1        ' move the background into page 1
  66.  
  67. put (0,271),dscene%,pset
  68. put (500,130),background0%,pset
  69. put (500-shift%,130),image1mask%,and
  70. put (500-shift%,130),image1%,or
  71.  
  72. ' Move the dinosaur across the screen
  73.  
  74. for x%=500-2*shift% to 20 step -2*shift%
  75. screen ,,0,1
  76. put (x%+2*shift%,130),background0%,pset
  77. get (x%,130)-(x%+xw%,130+yw%),background0%
  78. put (x%,130),image0mask%,and
  79. put (x%,130),image0%,or
  80. put (275,172),rockmask%,and
  81. put (275,172),rock%,or
  82. screen ,,1,0
  83. put (x%+shift%,130),background1%,pset
  84. get (x%-shift%,130)-(x%-shift%+xw%,130+yw%),background1%
  85. put (x%-shift%,130),image1mask%,and
  86. put (x%-shift%,130),image1%,or
  87. put (275,172),rockmask%,and
  88. put (275,172),rock%,or
  89.  
  90. ' a keystroke will toggle the dinosaur movement
  91.  
  92. if inkey$="" goto continue
  93. holdit: if inkey$="" goto holdit
  94. continue:
  95. next x%
  96.  
  97. pause: if inkey$="" goto pause
  98.  
  99.